#include "mainwindow.h"
#include "project_startup_interface.h"

#include <QApplication>
#include <QLocale>
#include <QTranslator>
#include <QObject>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    QTranslator translator;
    const QStringList uiLanguages = QLocale::system().uiLanguages();
    for (const QString &locale : uiLanguages) {
        const QString baseName = "eda_" + QLocale(locale).name();
        if (translator.load(":/i18n/" + baseName)) {
            a.installTranslator(&translator);
            break;
        }
    }

    project_startup_interface proInterface;
    MainWindow w;

    QObject::connect(&proInterface, &project_startup_interface::sendData, &w, &MainWindow::recv_proPathData);

    if (proInterface.exec() == QDialog::Accepted)
    {
        //w.show();
        w.showMaximized(); // 窗口以最大化显示
        return a.exec();
    }

    a.quit();
    return 0;
}
